import tensorflow as tf
import torch
import torchvision
import torchvision.transforms as transforms
import numpy as np

model = tf.keras.models.load_model('saved_model')

transform = transforms.Compose(
    [transforms.ToTensor(),
     transforms.Normalize(0.5, 0.5)])
testset = torchvision.datasets.MNIST(
    root='./data',
    train=False,
    download=True,
    transform=transform)
testloader = torch.utils.data.DataLoader(
    testset,
    batch_size=1,
    shuffle=False,
    num_workers=0)

for x, label in testloader:
    image = np.ascontiguousarray(np.transpose(x.numpy(), (0, 2, 3, 1)))
    y = model(image)[0]
    print('label={}, y={}'.format(label, pred.argmax()))
